home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1998 February
/
Macworld (1998-02).dmg
/
Inside Macworld
/
Alphamania 2 & Effector Sets
/
AlphaMania 2
/
Set FX.dir
/
00022_Script_Utility Scripts
< prev
next >
Wrap
Text File
|
1997-12-19
|
6KB
|
185 lines
-- Standard button handler will use a "down" member and return TRUE for a good click
on ButtonHandler sNum
if not sNum then set sNum = the clickOn
if sNum < 1 then return(FALSE)
set mNum = the memberNum of sprite sNum
if mNum < 0 then exit
set mName = the name of member mNum
if not stringP(mName) then exit
set the member of sprite sNum = member (mName&&"down")
set click = TRUE
updateStage
repeat while the mouseDown
if rollover(sNum) then
set the member of sprite sNum = member (mName&&"down")
set click = TRUE
else
set the member of sprite sNum = member (mName)
set click = FALSE
end if
updateStage
end repeat
if click then
set the member of sprite sNum = member (mName)
updateStage
return TRUE
else
return FALSE
end if
end
-- Puppet some sprites so that hold on through frame changes
on holdPuppets a, b
repeat with i = a to b
puppetSprite i, TRUE
end repeat
end
-- Turn off puppets of some sprites so they can change with next update
on releasePuppets a, b
repeat with i = a to b
puppetSprite i, FALSE
end repeat
end
-- Remove effects from display member
on resetDisplay
global fxDisplayMember
preLoad (member fxDisplayMember)
RemoveAllEffects(member fxDisplayMember)
end
-- Add 70 pixels to the window size so the user can see the help field
on ExpandWindow
global fxWindow, fxHelp
set r = the rect of fxWindow
set the bottom of r = (the top of r) + 300
set the rect of fxWindow = r
set the picture of member "helpButton" = the picture of member "helpButton on"
set fxHelp = TRUE
end
-- Take window to normal size
on CollapseWindow
global fxWindow, fxHelp
set r = the rect of fxWindow
set the right of r = (the left of r) + 528
set the bottom of r = (the top of r) + 230
set the rect of fxWindow = r
set the picture of member "helpButton" = the picture of member "helpButton off"
set fxHelp = FALSE
end
-- OK button pressed
-- Set stage member and close window
on OK
global fxTrackingObj
setMemberEffects(fxTrackingObj)
Cancel(0)
end
-- Settings window goes back to General Settings page
on Settings
if objectP(fxCurObj) then
release(fxCurObj)
end if
go to frame "General Member Settings"
end
-- About button goes to about page
on About
if objectP(fxCurObj) then
release(fxCurObj)
end if
go to frame "About"
end
-- Cancel button closes the window
on Cancel cleanUp
global fxTrackingObj, fxCurObj
if objectP(fxCurObj) then Release(fxCurObj)
if objectP(fxTrackingObj) then clearTests(fxTrackingObj)
if cleanUp then resetProperties(fxTrackingObj)
set fxTrackingObj = 0
closeWindow -- artificial call to closeWindow
tell the stage to updateStage
end
-- Check to make sure effect is present
on VerifySpriteEffect sNum, fxSym
if the type of member the castNum of sprite sNum = #alpha then
set fxl = GetEffectList(sprite sNum)
set pos = GetPos(fxl, fxSym)
return(pos)
end if
return(false)
end
-- Swap out sprite members to make them look active or dimmed
on enableInterfaceElement i, enabled
puppetSprite i, TRUE
if the memberNum of sprite i < 1 then exit
put the name of the member of sprite i into memname
if memname = "" then put the member of sprite i into memname
if enabled then
if the type of the member of sprite i = #bitmap then
if the depth of member memname = 1 then
set the foreColor of sprite i = 255
else if memname contains "Dim" then
put word 1 to (the number of words in memname)-1 of memname into memname
end if
set the member of sprite i = member memname
else if the type of the member of sprite i = #shape then
if the shapeType of the member of sprite i = #line then
set the foreColor of sprite i = 255
end if
else if the type of the member of sprite i = #field then
if field memname = "" then put "--" into field memname
set the foreColor of field memname = textColor(#black)
if the ink of sprite i = 0 then
set the editable of sprite i = TRUE
end if
end if
else
if the type of the member of sprite i = #bitmap then
if the depth of member memname = 1 then
set the foreColor of sprite i = 249
else if memname contains "Dim" then
nothing
else if memname contains "Down" then
put word 1 to (the number of words in memname)-1 of memname into memname
put " Dim" after memname
else
put " Dim" after memname
end if
if the number of member memname > 0 then
set the member of sprite i = member memname
end if
else if the type of the member of sprite i = #shape then
if the shapeType of the member of sprite i = #line then
set the foreColor of sprite i = 249
end if
else if the type of the member of sprite i = #field then
if field memname = "" then put "--" into field memname
set the foreColor of field memname = textColor(#gray)
if the ink of sprite i = 0 then
set the editable of sprite i = FALSE
end if
end if
end if
updateSTage
end
-- Use color field to produce text color number across palettes and color depths
on textColor c
if c = #black then
return the foreColor of word 1 of field "textcolors"
else if c = #gray then
return the foreColor of word 2 of field "textcolors"
end if
end